package com.css.dzj.dzjap.modules.lawenforcesuper.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "DRAW_EXPERT_RELATION_ERPERT", schema = "DZJAP", catalog = "")
public class DrawExpertRelationErpertEntity {
    private String id;
    private String expertSuperId;
    private String expertId;
    private String createPerson;
    private Date createTime;
    private String recordId;
    private String taskId;

    @Id
    @GeneratedValue(generator = "idGenerator")
    @GenericGenerator(name = "idGenerator", strategy = "com.css.dzj.dzjap.common.util.SnowflakeId")
    @Column(name = "ID")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "EXPERT_SUPER_ID")
    public String getExpertSuperId() {
        return expertSuperId;
    }

    public void setExpertSuperId(String expertSuperId) {
        this.expertSuperId = expertSuperId;
    }

    @Basic
    @Column(name = "EXPERT_ID")
    public String getExpertId() {
        return expertId;
    }

    public void setExpertId(String expertId) {
        this.expertId = expertId;
    }

    @Basic
    @Column(name = "CREATE_PERSON")
    public String getCreatePerson() {
        return createPerson;
    }

    public void setCreatePerson(String createPerson) {
        this.createPerson = createPerson;
    }

    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    @Basic
    @Column(name = "CREATE_TIME")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "RECORD_ID")
    public String getRecordId() {
        return recordId;
    }

    public void setRecordId(String recordId) {
        this.recordId = recordId;
    }

    @Basic
    @Column(name = "TASK_ID")
    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {return true;}
        if (o == null || getClass() != o.getClass()) {return false;}
        DrawExpertRelationErpertEntity that = (DrawExpertRelationErpertEntity) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(expertSuperId, that.expertSuperId) &&
                Objects.equals(expertId, that.expertId) &&
                Objects.equals(createPerson, that.createPerson) &&
                Objects.equals(createTime, that.createTime)&&
                Objects.equals(recordId, that.recordId)&&
                Objects.equals(taskId, that.taskId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, expertSuperId, expertId, createPerson, createTime,recordId, taskId);
    }
}
